package concurrent.producerconsumer;

import utils.DateTimeUtils;

import java.util.Date;

/**
 * Author: Jason Wu
 * Date  : 2014-03-11
 */
public class Task implements Runnable {
    private int taskId;

    public Task(int taskId) {
        this.taskId = taskId;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(1000);
            String time = DateTimeUtils.formatDateTime(new Date());
            System.out.println(String.format("taskId:%s, time:%s", taskId, time));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
